<?php

/**
 * 项目：红河移动工程过程管理系统
 *
 * 公司：红河移动分公司
 *
 * @author 李朝应
 *
 * E-mail:lichaoying.hh@163.com
 *
 */
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Setting_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    function setSetting($vars, $value) {
        $data = array(
            'value' => $value,
        );
        return $this->db->where('vars', $vars)->update('settings', $data)->affected_rows();
    }

    function getSetting($vars) {
        return $this->db->select('value')->where('vars', $vars)->get('settings')->row()->value;
    }

    function getAllSetting() {
        return $this->db->get('company');
    }

    function getSettingSum() {
        return $this->db->count_all('company');
    }

}